package com.tianqu.tms.www.proxymember.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TmsAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.entity.Codes;
import com.tianqu.tms.www.proxymember.actionform.ProxymemberCreationInputActionForm;
import com.tianqu.tms.www.proxymember.viewhelper.ProxyMemberCarSearchInputViewHelper;

/**
 * @author zhangxueliang
 * 待办车辆（已缴费）信息录入跳转action
 */
public class ProxyMemberCarPaidDispatchAction extends TmsAction{
	private Logger logger = Logger.getLogger(ProxyMemberCarPaidDispatchAction.class);
	@Override
	protected ActionForward doAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			UserContext uc) throws Exception {
		logger.debug(this.getClass().getName() + "#execute was called.");
		ProxymemberCreationInputActionForm proxyForm = (ProxymemberCreationInputActionForm)form;
		ProxyMemberCarSearchInputViewHelper viewhelp = new ProxyMemberCarSearchInputViewHelper();
		viewhelp = (ProxyMemberCarSearchInputViewHelper)uc.getAttribute(TmsConstants.VIEWHELP);
		Codes code = Codes.getInstance();
		viewhelp.setGainTypeList(code
				.getCodeslistByItemId(Codes.GAIN_TYPE));// 获得方式
		viewhelp.setTransferTypeList(code
				.getCodeslistByItemId(Codes.TRANSFER_TYPE));// 申请事项
	
		viewhelp.setOwnerTypeList(code
				.getCodeslistByItemId(Codes.CAR_OWNER));// 车主类型list
		
		viewhelp.setMoveOutCity(proxyForm.getMoveOutCity());
		viewhelp.setMoveOutProvince(proxyForm.getMoveOutProvince());
		viewhelp.setCarMarketIn(proxyForm.getCarMarketIn());
		
		viewhelp.setPrice(proxyForm.getPrice());
		viewhelp.setTaxNo(proxyForm.getTaxNo());
		viewhelp.setPaymentPeople(proxyForm.getPaymentPeople());
		viewhelp.setNewCarOwner(proxyForm.getNewCarOwner());
		viewhelp.setNewOwnerAddress(proxyForm.getNewOwnerAddress());
		viewhelp.setNewOwnerOrgNo(proxyForm.getNewOwnerOrgNo());
		viewhelp.setNewOwnerPhone(proxyForm.getNewOwnerPhone());
		viewhelp.setZipCode(proxyForm.getZipCode());
		viewhelp.setMailAddress(proxyForm.getMailAddress());
		viewhelp.setNewAgentAddress(proxyForm.getNewAgentAddress());
		viewhelp.setNewAgentName(proxyForm.getNewAgentName());
		viewhelp.setNewAgentOwnerIdCardNo(proxyForm.getNewAgentOwnerIdCardNo());
		viewhelp.setNewAgentPhone(proxyForm.getNewAgentPhone());
		viewhelp.setNewcarOwnerIdCardNo(proxyForm.getNewcarOwnerIdCardNo());
		uc.setAttribute(TmsConstants.VIEWHELP, viewhelp);
		
		logger.debug(this.getClass().getName() + "#execute was completed.");
		return mapping.findForward(TmsConstants.SUCCESS);
	}

}
